package models

import (
	"time"

	"github.com/astaxie/beego/orm"
	_ "github.com/mattn/go-sqlite3"
)

var Orm orm.Ormer

func init() {
	//orm.Debug = true
	// 需要在init中注册定义的model
	orm.RegisterModel(new(WakeOnLan))
	orm.DefaultTimeLoc = time.UTC
	err := orm.RegisterDataBase("default", "sqlite3", "./database.db")
	if err != nil {
		panic(err)
	}
	orm.RunSyncdb("default", false, true)
	Orm = orm.NewOrm()
	Orm.Using("default")
}
